<form method="POST">

    <div class="form-group">
		<label for="value">CPU Limit<br>
			<small class="form-text text-muted">
				This is the cpu limit of container
			</small>
		</label>
		<input type="text" class="form-control" name="cpu_limit" placeholder="Enter cpu limit of container" value="{{ challenge.cpu_limit }}">
	</div>
    <div class="form-group">
		<label for="value">Memory Limit<br>
			<small class="form-text text-muted">
				This is the memory limit of container
			</small>
		</label>
		<input type="text" class="form-control" name="memory_limit" placeholder="Enter memory limit of container" value="{{ challenge.memory_limit }}">

	</div>
	<div class="form-group">
		<label for="dirname">Dirname<br>
			<small class="form-text text-muted">
				The name of your challenge dirname
			</small>
		</label>
		<input type="text" class="form-control chal-name" name="dirname" value="{{ challenge.dirname }}">
	</div>
	<div class="form-group">
		<label for="value">Docker image name<br>
			<small class="form-text text-muted">
				The name of your challenge image (eg: d0g3/web_pyblog)
			</small>
		</label>
		<input type="text" class="form-control chal-name" name="image_name" value="{{ challenge.dirname }}">
	</div>
	<div class="form-group">
		<label for="name">Env Port<br>
			<small class="form-text text-muted">
				The inner port of your challenge
			</small>
		</label>
		<input type="text" class="form-control chal-name" name="env_port" value="{{ challenge.env_port }}">
	</div>
	<div class="form-group">
		<label for="name">Name<br>
			<small class="form-text text-muted">
				The name of your challenge
			</small>
		</label>
		<input type="text" class="form-control chal-name" name="name" value="{{ challenge.name }}">
	</div>
	<div class="form-group">
		<label for="category">Category<br>
			<small class="form-text text-muted">
				The category of your challenge
			</small>
		</label>
		<input type="text" class="form-control chal-category" name="category" value="{{ challenge.category }}">
	</div>
	<div class="form-group">
		<label for="value">Type<br>
			<small class="form-text text-muted">
				The type of your challenge (eg: web1)
			</small>
		</label>
		<input type="text" class="form-control" name="env_type" value="{{ challenge.env_type }}">
	</div>
	<div class="form-group">
		<label for="value">Language<br>
			<small class="form-text text-muted">
				The language of your challenge (eg: PHP)
			</small>
		</label>
		<input type="text" class="form-control" name="env_language" value="{{ challenge.env_language }}">
	</div>

	<ul class="nav nav-tabs" role="tablist" id="desc-edit">
		<li class="nav-item">
			<a class="nav-link active" href="#desc-write" id="desc-write-link" aria-controls="home"
			   role="tab" data-toggle="tab">
				Write
			</a>
		</li>
		<li class="nav-item">
			<a class="nav-link" href="#desc-preview" aria-controls="home" role="tab" data-toggle="tab">
				Preview
			</a>
		</li>
	</ul>
	<div class="tab-content">
		<div role="tabpanel" class="tab-pane active" id="desc-write">
			<div class="form-group">
				<label for="message-text" class="control-label">Message<br>
					<small class="form-text text-muted">
						Use this to give a brief introduction to your challenge.
					</small>
				</label>
				<textarea id="desc-editor" class="form-control chal-desc-editor" name="description"
						  rows="10">{{ challenge.description }}</textarea>
			</div>
		</div>
		<div role="tabpanel" class="tab-pane content" id="desc-preview"
			 style="height:214px; overflow-y: scroll;">
		</div>
	</div>

	<div class="form-group">
		<label for="value">Current Value<br>
			<small class="form-text text-muted">
				This is how many points the challenge is worth right now.
			</small>
		</label>
		<input type="number" class="form-control chal-value" name="value" value="{{ challenge.value }}" disabled>
	</div>

	<div class="form-group">
		<label for="value">Check Value<br>
			<small class="form-text text-muted">
				This is how many points the challenge was worth check-round.
			</small>
		</label>
		<input type="number" class="form-control chal-check-value" name="check_value" value="{{ challenge.check_value }}" required>
	</div>



	<div class="form-group">
		<label>
			Max Attempts<br>
			<small class="form-text text-muted">Maximum amount of attempts users receive. Leave at 0 for unlimited.</small>
		</label>

		<input type="number" class="form-control chal-attempts" name="max_attempts"
			   value="{{ challenge.max_attempts }}">
	</div>

	<div class="form-group">
		<label>
			State<br>
			<small class="form-text text-muted">Changes the state of the challenge (e.g. visible, hidden)</small>
		</label>

		<select class="form-control" name="state">
			<option value="visible" {% if challenge.state == "visible" %}selected{% endif %}>Visible</option>
			<option value="hidden" {% if challenge.state == "hidden" %}selected{% endif %}>Hidden</option>
		</select>
	</div>

	<div>
		<button class="btn btn-success btn-outlined float-right" type="submit">
			Update
		</button>
	</div>
</form>
